#ifndef COMMANDSTRING_H
#define COMMANDSTRING_H

#include "string.h"
#include "stdint.h"
#include "motor.h"
#include "RspTransmition.h"

extern UART_HandleTypeDef huart4;

static char CommandList[10][5] = {
"For","Bac","Lef","Rig","LeR","RiR"
};

uint8_t GetCommandLen(char* Command); // 给定开头为指令的字符串，返回字符串长度（手写Strlen）
uint8_t FindSignalIndex(char* Command, char Signal); // 给定开头为指令的字符串，返回分隔符的位置（以0开头）
uint16_t GetSpeedNumber(char* NumberIndex); // 给定数字开头的字符串指针，返回速度值
void GetCommandAndPerform(char* Command);


#endif
